﻿#include "ImageSaveWorker.h"

ImageSaveWorker::ImageSaveWorker(QObject *parent)
    : QObject{parent}
{
    mThreadPool.setMaxThreadCount(5);
}

void ImageSaveWorker::onInit()
{

}

void ImageSaveWorker::onImageSave(QList<ImageSaveInfo> lstData)
{
    for(auto data : lstData){
        SaveTask* task = new SaveTask(data);
        mThreadPool.start(task);
    }
}

void ImageSaveWorker::onQuit()
{
    deleteLater();
}
